import com.lb_stuff.mcmodify.location.LocChunkInRegion;
import com.lb_stuff.mcmodify.minecraft.Chunk;
import com.lb_stuff.mcmodify.minecraft.FileRegion;
import com.lb_stuff.mcmodify.minecraft.Mob;


public class RegionView
{
	public static void main(String[] args)throws Throwable{
		try{
			// new RegionTest().modifyEveryChunk();
			java.util.List<com.lb_stuff.mcmodify.nbt.Tag> gl = new java.util.ArrayList<>();
			FileRegion region = new FileRegion(TestingUtils.getInputFile(args[0]));
			for(int x = 0; x < 31; ++x){
				for(int z = 0; z < 31; ++z){
					gl.add(region.getTag(new LocChunkInRegion(x, z)));
				}
			}
			for(com.lb_stuff.mcmodify.nbt.Tag li: gl){
				System.out.println(li);
			}
		}
		catch(Throwable e){
			e.printStackTrace();
		}
	}
	public void modifyEveryChunk() throws Throwable
	{
		FileRegion region = new FileRegion(TestingUtils.getInputFile("r.0.0.mca.out"));
		// FileRegion newregion = new FileRegion(TestingUtils.getOutputFile("r.0.0.mca"));
		for(int x = 0; x < 31; ++x)
		{
			for(int z = 0; z < 31; ++z)
			{
				Chunk chunk = region.getChunk(new LocChunkInRegion(x, z));
				if(chunk != null)
				{
					chunk.Entities().add(new Mob.Pig(x*16+8, 6, z*16+8));
				}
				// newregion.setChunk(new LocChunkInRegion(x, z), chunk);
			}
		}
	}
}
